package book;

public class BookList {
//    使用一个长度为10的数组充当书架，来存放书籍
    private Book[] books=new Book[10];
//    当前书架中的书籍数量
    private int useSize;
//    使用构造方法，在实例化对象的同时，存放书架的初始书籍
    public BookList(){
        this.books[0]=new Book("三国演义","罗贯中",10,"小说");
        this.books[1]=new Book("西游记","吴承恩",45,"小说");
        this.books[2]=new Book("红楼梦","曹雪芹",67,"小说");
        this.useSize=3;
    }
    public int getUseSize(){
        return useSize;
    }
    public void setUseSize(int useSize){
        this.useSize=useSize;
    }
    public void SetBooks(Book book,int pos){
        this.books[pos]=book;
    }
    public Book getBook(int pos){
        return books[pos];
    }
    public Book setBooks(int pos){
        return this.books[pos];
    }
}
